package com.xbongbong.saas.enums;

import lombok.Getter;

/**
 * 外链类型枚举 1 填写 2 查询 3 分享
 */
@Getter
public enum OuterLinkTypeEnum {

    WRITE(1,"填写"),

    SEARCH(2,"查询"),

    SHARE(3,"分享"),
    ;

    /**
     * 设置类型标识
     */
    private Integer code;
    /**
     * 设置类型名字
     */
    private String name;


    OuterLinkTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static OuterLinkTypeEnum getByCode(Integer code) {
        for (OuterLinkTypeEnum cacheCode : values()) {
            if (cacheCode.getCode().equals(code)) {
                return cacheCode;
            }
        }
        return null;
    }
}
